package com.mallcloud.mall.mall.api.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.mallcloud.mall.common.core.constant.enums.mall.PointsProductStockEnum;
import com.mallcloud.mall.common.core.util.ValidGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

@ApiModel(value = "MallPointsProductStockRecordModel", description = "积分商品库存记录")
@Data
@TableName("GOODSLISTJFKC")
public class MallPointsProductStockRecordModel implements Serializable {
    private static final long serialVersionUID = 1L;

	@JsonSerialize(using = ToStringSerializer.class)
	@NotNull(message = "ID为空", groups = {ValidGroup.Update.class})
	@ApiModelProperty(value="商品库存编码，主键")
    @TableId(value = "icicode", type = IdType.ASSIGN_ID)
    private Long id;

    @ApiModelProperty(value="积分商品编码")
	@TableField("iciiccode")
    private String code;

    @ApiModelProperty(value="积分商品总库存")
	@TableField("icitotalinventory")
	private Long totalStock;

	@ApiModelProperty(value="积分商品现库存")
	@TableField("icinowinventory")
	private Long currentStock;

	/**
	 * {@link PointsProductStockEnum.OperationTypeEnum}
	 */
	@ApiModelProperty(value="库存操作类型")
	@TableField("icitype")
	private String operationType;

	@ApiModelProperty(value="库存变更数量")
	@TableField("iciamount")
	private Long changeQuantity;

	@ApiModelProperty(value="库存变更日期")
	@TableField(value = "icidatetime", fill = FieldFill.UPDATE)
	private Date updateTime;

	@ApiModelProperty(value="库存操作人")
	@TableField("iciczr")
	private String operator;

	/**
	 * {@link PointsProductStockEnum.OperationClassifyEnum}
	 */
	@ApiModelProperty(value="库存操作分类")
	@TableField("iciczrtype")
	private Integer OperationClassify;

	/**
	 * {@link PointsProductStockEnum.ReconciliationStatusEnum}
	 */
	@ApiModelProperty(value="对账状态")
	@TableField("icidzzt")
	private String reconciliationStatus;

	@ApiModelProperty(value="积分兑换记录编码")
	@TableField("iciiercode")
	private String RedemptionRecordCode;

}
